package com.wmc.controller;

import com.wmc.pojo.ClazzOption;
import com.wmc.pojo.JobOption;
import com.wmc.pojo.Result;
import com.wmc.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
import java.util.Objects;

@Slf4j
@RequestMapping("/report")
@RestController
public class ReportController {
    @Autowired
    private ReportService reportService;

    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        log.info("员工职位统计");
         JobOption jobOption = reportService.getEmpJobData();
         return Result.success(jobOption);
    }

    @GetMapping("/empGenderData")
    public Result getEmpSexData(){
        log.info("员工性别统计");
        List<Map<String, Object>> genderList = reportService.getEmpSexData();
        return Result.success(genderList);
    }

    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        log.info("学生学历统计");
        List<Map<String, Object>> degreeData =reportService.getStudentDegreeData();
        return Result.success(degreeData);
    }

    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        log.info("班级人数统计");
        ClazzOption clazzOption = reportService.getStudentCountData();
        return Result.success(clazzOption);

    }
}
